<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	$(function() {
		$('#inputForm input').tooltip();
		$('#inputForm').checkForm();
	
		$('#inputForm').ajaxForm({
			url : _ctx + "/registry/add_priority_conf.do",
			type : "post",
			dataType : "json",
			beforeSubmit : function() {
				$("#sbmBtn").attr("disabled", "disabled");
			},
			clearForm : false,
			resetForm : false,
			success : function(resp) {
				if (resp.status == '1') {
					ui.msg(resp.msg, 1);
					initDataTree(${param.type});
				} else {
					ui.msg(resp.msg, 0);
				}
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			},
			error : function(resp) {
				ui.msg('请求发送失败', 0);
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			}
		});
		
		var limitType="${conf.limitType}";
	   	$("#limitType"+limitType).attr("checked", "true");
		$("#beginValue"+limitType).val("${conf.beginValue}");
		$("#endValue"+limitType).val("${conf.endValue}");
		changLimitType();
	});
	
</script>
<c:set var="nodeInfo" value="${_data}" />
<div class="table-responsive">
	<div class="row">
		<div class="col-xs-12">
			<div class="widget-main">
				<div class="profile-user-info profile-user-info-striped">
					<div class="profile-info-row">
						<div class="profile-info-name">节点编码</div>
						<div class="profile-info-value">
							<span class="editable">${nodeInfo.nodeCode}&nbsp;</span>
						</div>
					</div>
					<div class="profile-info-row">
						<div class="profile-info-name">节点名称</div>
						<div class="profile-info-value">
							<span class="editable">${nodeInfo.nodeName}&nbsp;</span>
						</div>
					</div>
					<div class="profile-info-row">
						<div class="profile-info-name">行政区</div>
						<div class="profile-info-value">
							<span class="editable">${orgInfo.adNm}&nbsp;</span>
						</div>
					</div>
					<div class="profile-info-row">
						<div class="profile-info-name">管理员邮箱</div>
						<div class="profile-info-value">
							<span class="editable">${nodeInfo.adminEmail}&nbsp;</span>
						</div>
					</div>
					<div class="profile-info-row">
						<div class="profile-info-name">同步地址</div>
						<div class="profile-info-value">
							<span class="editable">${nodeInfo.installUrl}&nbsp;</span>
						</div>
					</div>
					<div class="profile-info-row">
						<div class="profile-info-name">是否有网闸</div>
						<div class="profile-info-value">
							<span class="editable">${si:yesNoStr(nodeInfo.hasGap)}&nbsp;</span>
						</div>
					</div>
					<div class="profile-info-row">
						<div class="profile-info-name">包含系统</div>
						<div class="profile-info-value">
							<c:forEach var="vo" items="${sysInfoList}" varStatus="idx">
								<c:if test="${idx.index%4==0 &&  idx.index!=0 }">
									<P>
								</c:if>
								<span class="editable">${vo.sysName}&nbsp;</span>
							</c:forEach>
							&nbsp;
						</div>
					</div>
					<div class="profile-info-row">
						<div class="profile-info-name">修改时间</div>
						<div class="profile-info-value">
							<span class="editable">${si:fmtDate(nodeInfo.mtime)}&nbsp;</span>
						</div>
					</div>
				</div>
				<div class="space-4"></div>
				<h5 class="header smaller lighter blue" style=" margin-top: 0px;margin-bottom: 0px;  ">优先级配置<c:if test='${ conf.status eq 0}'><font size="2" color="red" style="padding-left: 520px;">配置已失效</font></c:if></h5>
				<form class="form-horizontal" role="form" id="inputForm" style="margin-left: -120px;"  onsubmit="setValue();"
					action="" method="post">
					<input type="hidden" id="id" name="id" value="${conf.id}"/>
					<input type="hidden" id="ownId" name="ownId" value="${nodeInfo.id}"/>
					<input type="hidden" id="ownType" name="ownType" value="${param.type}"/>
					<input type="hidden" id="beginValue" name="beginValue" value="${conf.beginValue}"/>
					<input type="hidden" id="endValue" name="endValue" value="${conf.endValue}"/>
					<div class="form-group" style="padding-top: 0px;">
						<div class="col-sm-3 control-label no-padding-right" style="padding-top: 15px;color: #336199;"
							for="form-field-1">优先级别*</div>
						<div class="col-sm-9" style="vertical-align: top;">
							<div class="col-sm-9" style="padding-top: 7px;" id="type1">
								<select id="priority" name="priority">
									${si:ctoption("PRIORITY_LEVEL", conf.priority) }
								 </select>
							</div>
						</div>
					</div>
					<div class="form-group" style="padding-top: 0px;">
						<div class="col-sm-3 control-label no-padding-right" style="padding-top: 15px;color: #336199;"
							for="form-field-1">生效条件*</div>
						<div class="col-sm-9" style="vertical-align: top;">
							<div class="col-sm-9" style="padding-top: 7px;" id="type1">
							<input type="radio" name="limitType"  id="limitType1"  value="1" class="ace"  checked="checked" onclick="changLimitType();">
								<span class="lbl">&nbsp;固定时间范围</span> &nbsp;&nbsp; 
								<input type="text" class="" name="beginValue1" id="beginValue1" style="width: 145px;" 
									onfocus="WdatePicker({onpicked:putDate(),dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'endValue1\')}'})"/>
								~&nbsp;<input type="text" class=""  name="endValue1" id="endValue1" style="width: 145px;"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'beginValue1\')}'})"/>
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-3 control-label no-padding-right"
							for="form-field-1"></div>
						<div class="col-sm-9" style="padding-top: 1px;padding-left: 25px;vertical-align: top;">
						<input type="radio" name="limitType" id="limitType2"  value="2" class="ace" onclick="changLimitType();">
								<span class="lbl">&nbsp;固定发送次数</span> &nbsp;&nbsp; 
							<input type="hidden" name="beginValue2" id="beginValue2" value="0"> 
							<input type="text" name="endValue2"  datatype="number" msg="请输入数字"  id="endValue2"  style="width: 65px;">
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-3 control-label no-padding-right"
							for="form-field-1"></div>
						<div class="col-sm-9" style="padding-top: 1px;padding-left: 25px;vertical-align: top;">
							<input type="radio" name="limitType" id="limitType3"  value="3" class="ace"  onclick="changLimitType();">
								<span class="lbl">&nbsp;固定文件总大小(MB)</span> &nbsp;
							<input type="hidden" name="beginValue3"  id="beginValue3"  value="0"> 
							<input type="text" name="endValue3"  datatype="number" msg="请输入数字"  id="endValue3"  style="width: 65px;">
						</div>
					</div>
					<div class="clearfix form-group" style="margin-bottom: 0px; ">
						<div class="col-md-offset-6 col-md-6">
							<button type="submit" class="btn btn-sm btn-info"  
								id="sbmBtn">
								<i class="icon-ok bigger-110"></i>提交
							</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
